package GUI;

import java.awt.Graphics;

import javax.swing.JPanel;

import stochastic.Solution;

public class VisualizerPanel extends JPanel{
	protected IVizualizer vizualizer;
	protected Solution sol;
	public VisualizerPanel() {
		vizualizer = null;
		sol = null;
		
	} 
	public void paint(Graphics g) {
		if(vizualizer == null || sol == null)
			return;
		vizualizer.draw(sol, this);
		
	}
	
	public void setVisualizer(IVizualizer v) {
		vizualizer = v;
	}
	
	protected void setSolution(Solution s) {
		sol=s;
		this.update(getGraphics());
	}
}
